<?php



/**

 * Routes configuration

 *

 * In this file, you set up routes to your controllers and their actions.

 * Routes are very important mechanism that allows you to freely connect

 * different urls to chosen controllers and their actions (functions).

 *

 * PHP 5

 *

 * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)

 * Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)

 *

 * Licensed under The MIT License

 * Redistributions of files must retain the above copyright notice.

 *

 * @copyright     Copyright 2005-2012, Cake Software Foundation, Inc. (http://cakefoundation.org)

 * @link          http://cakephp.org CakePHP(tm) Project

 * @package       app.Config

 * @since         CakePHP(tm) v 0.2.9

 * @license       MIT License (http://www.opensource.org/licenses/mit-license.php)

 */

/**

 * Here, we are connecting '/' (base path) to controller called 'Pages',

 * its action called 'display', and we pass a param to select the view file

 * to use (in this case, /app/View/Pages/home.ctp)...

 */













/**

 * ...and connect the rest of 'Pages' controller's urls.

 */



/************* SAN PHAM *************************/

Router::connect('/', array('controller' => 'Home', 'action' => 'index'));

Router::connect('/san-pham/*', array('controller' => 'Product', 'action' => 'index'));

Router::connect('/san-pham-chi-tiet/*', array('controller' => 'Product', 'action' => 'detail'));

Router::connect('/shopping-cart/*', array('controller' => 'Product', 'action' => 'shopping_cart'));

Router::connect('/add-shopping-cart/*', array('controller' => 'Product', 'action' => 'add_shopping_cart'));

Router::connect('/delete-shopping-cart/*', array('controller' => 'Product', 'action' => 'delete_shopping_cart'));

Router::connect('/update-shopping-cart/*', array('controller' => 'Product', 'action' => 'update_shopping_cart'));

Router::connect('/search/*', array('controller' => 'Product', 'action' => 'search'));

Router::connect('/advance-search/*', array('controller' => 'Product', 'action' => 'advance_search'));

Router::connect('/check-out/*', array('controller' => 'Product', 'action' => 'shopping_cart_checkout'));



/************ TIN TUC **************************/

Router::connect('/tin-tuc/*', array('controller' => 'News', 'action' => 'index'));

Router::connect('/danh-muc-tin/*', array('controller' => 'News', 'action' => 'category'));

Router::connect('/chi-tiet-tin/*', array('controller' => 'News', 'action' => 'detail'));



/************ USER *****************************/

Router::connect('/login/*', array('controller' => 'User', 'action' => 'login'));

Router::connect('/logout/*', array('controller' => 'User', 'action' => 'logout'));

Router::connect('/register/*', array('controller' => 'User', 'action' => 'register'));

Router::connect('/account/*', array('controller' => 'User', 'action' => 'userinfo'));

Router::connect('/forgot-password/*', array('controller' => 'User', 'action' => 'forgot_pass'));

Router::connect('/change-password/*', array('controller' => 'User', 'action' => 'change_pass'));

Router::connect('/reget-password/*', array('controller' => 'User', 'action' => 'reget_pass'));



/************ ALBUM ANH ************************/





/************ SINGLE PAGE **********************/

Router::connect('/gioi-thieu/*', array('controller' => 'Post', 'action' => 'detail', 1));

Router::connect('/thong-tin/*', array('controller' => 'Home', 'action' => 'contact'));

Router::connect('/faqs.html/*', array('controller' => 'Home', 'action' => 'faqs'));

Router::connect('/buy-3d-models.html/*', array('controller' => 'Home', 'action' => 'buy_model'));

/**

 * Load all plugin routes.  See the CakePlugin documentation on 

 * how to customize the loading of plugin routes.

 */

CakePlugin::routes();



/**

 * Load the CakePHP default routes. Remove this if you do not want to use

 * the built-in default routes.

 */

require CAKE . 'Config' . DS . 'routes.php';

